<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2017-2021 Contributors to the Eclipse Foundation

    See the NOTICE file(s) distributed with this work for additional
    information regarding copyright ownership.

    Licensed under the Apache License, Version 2.0 (the "License");
    You may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    Contributors:
      2018-09-29 - Rudy De Busscher
         Initially authored in Atbash Jessie

-->
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
>

<h:head>
    <title>Starter | MicroProfile</title>
    <h:outputStylesheet library="css" name="starter-1.4.css"/>
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet"/>
    <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"/>
    <link rel="shortcut icon" type="image/x-icon" href="resources/img/mp.ico"/>
    <h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
</h:head>

<h:body>
    <div class="header">
        <div class="header-title header-text-2">MicroProfile Starter</div>
        <div class="header-title header-text-1 header-yellow">Generate MicroProfile Maven Project with Examples</div>
        <a href="https://github.com/eclipse/microprofile-starter/issues" class="feedback">
            <span class="ui-button-text ui-c">See The Code</span>
        </a>
        <a href="https://microprofile.io" class="logo">
            <img src="resources/img/MP-logo-w-tagline-1.png" alt="MicroProfile" height="50"/>
        </a>
    </div>

    <div class="page-wrapper">
        <h:form id="frm" pt:autocomplete="off">

            <div class="mainArea">

                <div class="content">
                    <p:messages showSummary="true" showDetail="false" autoUpdate="true"/>
                    <p:panelGrid columns="2" columnClasses="ui-grid-col-6 label-row, ui-grid-col-6 label-row" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid">
                        <p:outputLabel value="groupId" for="groupId"/>
                        <p:outputLabel value="artifactId" for="artifactId"/>
                    </p:panelGrid>

                    <p:panelGrid columns="2" columnClasses="ui-grid-col-6, ui-grid-col-6" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid">
                        <p:inputText id="groupId" label="groupId" value="#{generatorDataBean.engineData.mavenData.groupId}" required="true"
                                     title="Used as part of the package name so it must comply with the Java rules"
                                     pt:autocomplete="off">
                            <f:validator validatorId="packageNameValidator"/>
                        </p:inputText>

                        <p:inputText id="artifactId" label="artifactId" value="#{generatorDataBean.engineData.mavenData.artifactId}" required="true"
                                     title="Used as part of the package name so it must comply with the Java rules.  Hyphen is converted to . in package name"
                                     pt:autocomplete="off">
                            <f:validator validatorId="packageNameValidator"/>
                        </p:inputText></p:panelGrid>

                    <p:panelGrid columns="2" columnClasses="ui-grid-col-6 label-row, ui-grid-col-6 label-row" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid">
                        <p:outputLabel value="MicroProfile Version" for="mpVersion"/>
                        <p:outputLabel value="Java SE Version" for="javaSEVersion"/>
                    </p:panelGrid>

                    <p:panelGrid columns="2" columnClasses="ui-grid-col-6, ui-grid-col-6" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid">
                        <p:selectOneMenu id="mpVersion" value="#{generatorDataBean.engineData.mpVersion}" var="item">
                            <f:selectItems value="${dataBean.mpItems}"/>
                            <p:ajax listener="#{generatorDataBean.onMPVersionSelected}" update="options, javaSEVersion"/>
                            <p:column>
                                <h:outputText value="#{item}" />

                                <a href="#{dataBean.getVersionReleasePage(item)}" target="blank">
                                    <i class="pi pi-external-link"></i>
                                </a>
                            </p:column>

                        </p:selectOneMenu>

                        <p:selectOneMenu id="javaSEVersion" value="#{generatorDataBean.engineData.javaSEVersion}"
                                         disabled="#{not generatorDataBean.javaSEEnabled}">
                            <f:selectItems value="${generatorDataBean.javaSEItems}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:tooltip id="groupIdToolTipFocus" for="groupId" showEvent="focus" hideEvent="blur" position="bottom"/>
                    <p:tooltip id="artifactIdToolTipFocus" for="artifactId" showEvent="focus" hideEvent="blur" position="bottom"/>


                    <h3>Project Options</h3>

                    <p:panelGrid columns="2" columnClasses="ui-grid-col-6, ui-grid-col-6" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid" id="options">
                        <p:panelGrid columns="1" columnClasses="ui-grid-col-12" layout="grid"
                                     styleClass="ui-panelgrid-blank ui-fluid nested">
                            <p:outputLabel value="Build Tool" for="buildTool"/>
                            <p:selectOneRadio id="buildTool" value="#{generatorDataBean.engineData.buildTool}" layout="responsive" columns="2"
                                disabled="#{not generatorDataBean.hasGradleSupport()}">
                                <f:selectItem itemLabel="Maven" itemValue="Maven" />
                                <f:selectItem itemLabel="Gradle" itemValue="Gradle" />
                                <p:ajax process="@this" listener="#{generatorDataBean.onBuildToolSelected}" update="options"/>
                            </p:selectOneRadio>

                            <p:outputLabel value="MicroProfile Runtime" for="supportedServer"/>

                            <p:selectOneMenu id="supportedServer" value="#{generatorDataBean.engineData.supportedServer}"
                                             required="true" var="item">
                                <f:selectItem noSelectionOption="true" itemLabel=" "/>
                                <f:selectItems value="${generatorDataBean.supportedServerItems}"/>
                                <p:ajax listener="#{generatorDataBean.onMPRuntimeSelected}" update="options, mpVersion, javaSEVersion, buildTool"/>

                                <p:column>
                                    <h:outputText value="#{dataBean.getRuntimeName(item)}" rendered="#{not empty item}"/>

                                    <a href="#{dataBean.getHomePage(item)}" target="blank">
                                        <i class="pi pi-external-link"></i>
                                    </a>
                            </p:column>

                            </p:selectOneMenu>
                        </p:panelGrid>
                        <h:panelGroup>
                            <p:outputLabel value="Examples for specifications" for="microprofileSpecs"/> <h:outputText value="&#160;" />
                            <p:commandLink value="Select All" actionListener="#{generatorDataBean.selectAll}" update="microprofileSpecs, microprofileStandaloneSpecs"
                                           ajax="true" process="@this"
                                           rendered="#{not empty generatorDataBean.engineData.mpVersion}"/>
                            <h:outputText value="&#160;" /><h:outputText value="&#160;" />
                            <p:commandLink value="Clear All" actionListener="#{generatorDataBean.unselectAll}" update="microprofileSpecs, microprofileStandaloneSpecs"
                                           ajax="true" process="@this"
                                           rendered="#{not empty generatorDataBean.engineData.mpVersion}"/>
                            <p:selectManyCheckbox id="microprofileSpecs" value="#{generatorDataBean.selectedSpecs}"
                                                  layout="responsive" styleClass="specifications"
                                                  columns="2" disabled="#{empty generatorDataBean.engineData.mpVersion}">
                                <f:selectItems value="#{generatorDataBean.specs}" var="spec" itemLabel="#{spec}"
                                               itemValue="#{spec}"/>
                                <p:ajax process="@this" />
                                <f:facet name="label">
                                    <h:outputText value="#{item.label}"/>
                                    <a href="#{generatorDataBean.getSpecificationLink(item)}" target="blank">
                                        <i class="pi pi-external-link"></i>
                                    </a>
                                </f:facet>
                                <f:facet name="tooltip">
                                    <h:outputText value="#{item.description}"/>
                                </f:facet>
                            </p:selectManyCheckbox>
                            <h:panelGroup rendered="#{not empty generatorDataBean.standaloneSpecs}">
                                <p:separator />
                                <p:selectManyCheckbox id="microprofileStandaloneSpecs" value="#{generatorDataBean.selectedStandaloneSpecs}"
                                                      layout="responsive" styleClass="specifications"
                                                      columns="2" >
                                    <f:selectItems value="#{generatorDataBean.standaloneSpecs}" var="spec" itemLabel="#{spec}"
                                                   itemValue="#{spec}" />
                                    <p:ajax process="@this" />
                                    <f:facet name="label">
                                        <h:outputText value="#{item.label}"/>
                                        <a href="#{generatorDataBean.getSpecificationStandaloneLink(item)}" target="blank">
                                            <i class="pi pi-external-link"></i>
                                        </a>
                                    </f:facet>
                                    <f:facet name="tooltip">
                                        <h:outputText value="#{item.description}"/>
                                    </f:facet>

                                </p:selectManyCheckbox>
                            </h:panelGroup>
                        </h:panelGroup>


                    </p:panelGrid>
                    <p:panelGrid columns="1" columnClasses="ui-grid-col-12" layout="grid"
                                 styleClass="ui-panelgrid-blank ui-fluid download-cell">

                        <h:panelGroup>
                            <p:commandButton value="Download"
                                             actionListener="#{generatorDataBean.generateProject}" ajax="false"/>
                            
                        </h:panelGroup>
                    </p:panelGrid>


                </div>

            </div>
        </h:form>
    </div>

    <div class="footer-outer">
        <div class="footer-widgets">
            <p:panelGrid columns="4" columnClasses="ui-grid-col-3" layout="grid"
                         styleClass="ui-panelgrid-blank ui-fluid">
                <h:panelGroup>
                    <a href="http://microprofile.io/"><img
                            width="150" height="35"
                            src="https://microprofile.io/wp-content/uploads/2018/06/eclipse_logo_white-300x70.png"
                            alt="" style="max-width: 100%; height: auto;"/></a>
                </h:panelGroup>
                <h:panelGroup>
                    <a href="http://www.eclipse.org/">Eclipse Foundation</a>
                </h:panelGroup>
                <h:panelGroup>
                    <a href="https://www.eclipse.org/legal/privacy.php">Privacy Policy</a>
                </h:panelGroup>
                <h:panelGroup>
                    <a  href="https://www.eclipse.org/legal/copyright.php">Copyright Agent</a>
                </h:panelGroup>
                <h:panelGroup/>
                <h:panelGroup/>
                <h:panelGroup>
                    <a href="https://eclipse.org/legal/termsofuse.php">Terms of Use</a>
                </h:panelGroup>
                <h:panelGroup>
                    <a href="http://www.eclipse.org/legal/">Legal</a>
                </h:panelGroup>
            </p:panelGrid>
        </div>
    </div>
    <div class="copyright">
        <p:panelGrid columns="4" columnClasses="ui-grid-col-5, ui-grid-col-7 " layout="grid"
                     styleClass="ui-panelgrid-blank ui-fluid">

            <h:panelGroup>
                <p>&copy; 2019 Microprofile. Eclipse MicroProfile is an open source project under the Apache License 2.0.</p>
                <p id="REST"></p>
                <script src="resources/script/getHost.js"></script>
                <p><h:outputText value="#{generatorDataBean.version.git}"/></p>
            </h:panelGroup>
            <h:panelGroup>
                <ul class="social">
                    <li><a target="_blank" href="https://twitter.com/microprofileio"><i class="fa fa-twitter"/>
                    </a></li>
                    <li><a target="_blank" href="https://www.facebook.com/microprofile.io/"><i
                            class="fa fa-facebook"/> </a></li>
                    <li><a target="_blank" href="https://www.linkedin.com/company/microprofileio/"><i
                            class="fa fa-linkedin"/> </a></li>
                </ul>
            </h:panelGroup>
        </p:panelGrid>
    </div>


</h:body>

</html>